﻿using Dynamic.Api.TestService.Model;
using Dynamic.Utils;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Dynamic.Api.TestService
{
    /// <summary>
    /// 控制器名称
    /// </summary>
    public interface IEmployeeService : IDynamicWebApi
    {
        /// <summary>
        /// 方法名称
        /// </summary>
        /// <returns></returns>
        [HttpGet("employees")]
        [AllowAnonymous]
        Task<List<Employee>> GetAll();

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        [HttpPost]
        Task<bool> AddUserAsync([FromBody]string userId, [FromBody]string userName);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        [HttpDelete]
        Task<bool> DeleteUserAsync([FromBody] IdParam userId);

    }

    /// <summary>
    /// 参数类
    /// </summary>
    public class IdParam
    {
        public string userId { get; set; }
    }
}
